﻿namespace Engine.Plot
{
    /// <summary>
    /// Used for display results of calculating dependance conductivity
    /// on number of working points
    /// </summary>
    public class PlotPoint
    {
        /// <summary>
        /// Number of working points normalize to one.
        /// </summary>
        private readonly double _x;
        
        /// <summary>
        /// Conductance of lattice.
        /// </summary>
        private readonly double _conductance;

        /// <summary>
        /// Id of lattice to which we its related
        /// </summary>
        private readonly long _latticeId;

        /// <summary>
        /// Determine result type: or this result for studied lattice or for norm lattice.
        /// </summary>
        private readonly ResultType _type;

        /// <summary>
        /// Conductance of elements in lattice.
        /// </summary>
        private double _elementConductance;
                

        /// <summary>
        /// Create instance
        /// </summary>
        /// <param name="x">Number of working points normalize to one.</param>
        /// <param name="conductance">Conductance of lattice.</param>
        public PlotPoint(double x, double conductance)
        {
            _x = x;
            _conductance = conductance;
        }

        /// <summary>
        /// Create instance
        /// </summary>
        ///<param name="x">Number of working points normalize to one.</param>
        /// <param name="conductance">Conductance of lattice.</param>
        /// <param name="latticeId">Id of lattice</param>
        public PlotPoint(double x, double conductance, long latticeId) 
        :this( x , conductance)
        {
            _latticeId = latticeId;
        }

        /// <summary>
        /// Create instance
        /// </summary>
        ///<param name="x">Number of working points normalize to one.</param>
        /// <param name="conductance">Conductance of lattice.</param>
        /// <param name="latticeId">Result type of lattice</param>
        public PlotPoint(double x, double conductance, long latticeId, ResultType type)
            : this(x, conductance, latticeId)
        {
            _type = type;
        }

        ///<summary>
        /// Number of working points normalize to one.
        ///</summary>
        public double X
        {
            get { return _x; }
        }

        ///<summary>
        /// Conductance of lattice.
        ///</summary>
        public double Conductance
        {
            get { return _conductance; }
        }
        
        /// <summary>
        /// Gets lattice id property
        /// </summary>
        public long LatticeId 
        {
            get { return _latticeId; } 
        }

        /// <summary>
        /// Returns result type
        /// </summary>
        public ResultType Type {
            get { return _type; }
        }

        /// <summary>
        /// Conductance of elements in lattice.
        /// </summary>
        public double ElementConductance {
            get { return _elementConductance; }
            set { _elementConductance = value; }
        }
    }
}
